import { Entity, Column, PrimaryGeneratedColumn , ManyToOne , OneToOne , JoinColumn } from 'typeorm';
import { Teams } from './teams';
import { Season } from './season';
import { SeasonType } from './season_type';

@Entity()
class TeamRankData {

    @PrimaryGeneratedColumn("uuid")
    id?: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场领先时负场"
    })
    aheadAtHalfLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场领先时胜场"
    })
    aheadAtHalfWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "三节领先时负场"
    })
    aheadAtThirdLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "三节领先时胜场"
    })
    aheadAtThirdWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场落后时负场"
    })
    behindAtHalfLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场落后时胜场"
    })
    behindAtHalfWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "三节落后时负场"
    })
    behindAtThirdLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "三节落后时胜场"
    })
    behindAtThirdWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "不知道啥意思"
    })
    clinched: string;

    @Column({
        type: "int",
        comment: "分区胜场差"
    })
    confGamesBehind: number;

    @Column({
        type: "int",
        comment: "分区负场"
    })
    confLoss: number;

    @Column({
        type: "int",
        comment: "分区排名"
    })
    confRank: number;

    @Column({
        type: "int",
        comment: "分区胜场"
    })
    confWin: number;

    @Column({
        type: "int",
        comment: "赛区胜场差"
    })
    divGameBehind: number;

    @Column({
        type: "int",
        comment: "赛区负场"
    })
    divLoss: number;

    @Column({
        type: "int",
        comment: "赛区排名"
    })
    divRank: number;

    @Column({
        type: "int",
        comment: "赛区胜场"
    })
    divWin: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "更少失误负场"
    })
    fewerTurnoversLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "更少失误胜场"
    })
    fewerTurnoversWin: string;

    @Column({
        type: "int",
        comment: "主场负场"
    })
    homeLoss: number;

    @Column({
        type: "varchar",
        length: 25,
        comment: "主场连败"
    })
    homeStreak: string;

    @Column({
        type: "int",
        comment: "主场胜场"
    })
    homeWin: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "最近10场比赛胜负场"
    })
    last10: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "最近10个主场比赛胜负场"
    })
    last10Home: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "最近10个客场比赛胜负场"
    })
    last10Road: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "命中率领先负场"
    })
    leadInFgpctloss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "命中率领先胜场"
    })
    leadInFgpctwin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "篮板领先负场"
    })
    leadInRebLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "篮板领先胜场"
    })
    leadInRebWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "连败"
    })
    loseStreak: string;

    @Column({
        type: "int",
        comment: "总负场"
    })
    losses: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "是否正在连败"
    })
    onHotStreak: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "对手胜率超过50%时，负场数"
    })
    oppover500Loss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "对手胜率超过50%时，胜场数"
    })
    oppover500Win: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "对手得分100+时，负场数"
    })
    oppscore100PlusLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "对手得分100+时，胜场数"
    })
    oppscore100PlusWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "加时赛负场数"
    })
    otloss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "加时赛胜场数"
    })
    otwin: string;

    @Column({
        type: "int",
        comment: "场均失分"
    })
    pointsAgainst: number;

    @Column({
        type: "int",
        comment: "场均分差"
    })
    pointsDiff: number;

    @Column({
        type: "int",
        comment: "场均得分"
    })
    pointsFor: number;

    @Column({
        type: "int",
        comment: "客场负场"
    })
    roadLoss: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "客场连败数"
    })
    roadStreak: string;

    @Column({
        type: "int",
        comment: "客场胜场"
    })
    roadWin: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "得分100+是负场"
    })
    score100PlusLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "得分100+时胜场"
    })
    score100PlusWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "连败"
    })
    streak: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "分差大于十分负场"
    })
    tenPtsOrMoreLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "分差大于十分胜场"
    })
    tenPtsOrMoreWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "分差小于三分负场"
    })
    threePtsOrLessLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "分差小于三分胜场"
    })
    threePtsOrLessWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场打平负场"
    })
    tiedAtHalfLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "半场打平胜场"
    })
    tiedAtHalfWin: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "第三节打平负场"
    })
    tiedAtThirdLoss: string;

    @Column({
        type: "varchar",
        length: 255,
        comment: "第三节打平胜场"
    })
    tiedAtThirdWin: string;

    @Column({
        type: "int",
        comment: "胜率"
    })
    winPct: number;

    @Column({
        type: "varchar",
        length: 255,
        comment: "连胜"
    })
    winStreak: string;

    @Column({
        type: "int",
        comment: "胜场数"
    })
    wins: number;

    @ManyToOne(type => Teams)
    @JoinColumn()
    teams: Teams;

    // 好像只有最近一个赛季的常规赛数据，所以暂时取消赛季相关
    // 还是先放开吧 写死18赛季 常规赛
    @ManyToOne(type => Season)
    season?: Season;

    @ManyToOne(type => SeasonType)
    seasonType?: SeasonType;

    // @ManyToOne(type => Teams,teams => teams.id)
    // teams: Teams;

    // @ManyToOne(type => Season, season => season.id)
    // season: Season;

    // @ManyToOne(type => SeasonType, seasonType => seasonType.id)
    // seasonType: SeasonType;

}

export { TeamRankData };